#include "app.h"
#include "widgets.h"
#include "gui.h"
#include "avahi.h"
#include "server.h"

int main( int   argc,
          char *argv[] )
{
	pthread_t avahi_thread, server_thread;
	
	//gdk_threads_set_lock_functions(G_CALLBACK(init_avahi),G_CALLBACK(avahi_timeout_event));
	g_thread_init(NULL);
	gdk_threads_init();	
	
	pthread_create(&avahi_thread,NULL,(void *)init_avahi,NULL);
	pthread_create(&server_thread,NULL,(void *)init_server,NULL);
	
	gdk_threads_enter();
		gtk_init(&argc, &argv);
		gchar * locale = gtk_set_locale();
		printf("(MAIN)locale: %s\n", locale);
		init_app();
		init_widgets();	
		gtk_main();
	gdk_threads_leave();
	
	return 0;
}
